home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection Student Program / ADC Tools Sampler CD Disk 3 1999.iso / Metrowerks CodeWarrior / Java Support / Java_Source / Java2 / src / javax / accessibility / AccessibleSelection.java < prev    next >
Encoding:
Java Source  |  1999-05-28  |  3.7 KB  |  105 lines  |  [TEXT/CWIE]

  1. /*
  2.  * @(#)AccessibleSelection.java    1.7 98/08/26
  3.  *
  4.  * Copyright 1997, 1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package javax.accessibility;
  16.  
  17. /**
  18.  * This AccessibleSelection interface
  19.  * provides the standard mechanism for an assistive technology to determine 
  20.  * what the current selected children are, as well as modify the selection set.
  21.  * Any object that has children that can be selected should support this
  22.  * the AccessibleSelection interface.  Applications can determine if an object supports the 
  23.  * AccessibleSelection interface by first obtaining its AccessibleContext (see
  24.  * {@link Accessible}) and then calling the
  25.  * {@link AccessibleContext#getAccessibleSelection} method.
  26.  * If the return value is not null, the object supports this interface.
  27.  *
  28.  * @see Accessible
  29.  * @see Accessible#getAccessibleContext
  30.  * @see AccessibleContext
  31.  * @see AccessibleContext#getAccessibleSelection
  32.  *
  33.  * @version     1.7 08/26/98 21:14:11
  34.  * @author    Peter Korn
  35.  * @author      Hans Muller
  36.  * @author      Willie Walker
  37.  */
  38. public interface AccessibleSelection {
  39.  
  40.     /**
  41.      * Returns the number of Accessible children currently selected.
  42.      * If no children are selected, the return value will be 0.
  43.      *
  44.      * @return the number of items currently selected.
  45.      */
  46.      public int getAccessibleSelectionCount();
  47.  
  48.     /**
  49.      * Returns an Accessible representing the specified selected child
  50.      * in the object.  If there isn't a selection, or there are 
  51.      * fewer children selected than the integer passed in, the return
  52.      * value will be null.
  53.      * <p>Note that the index represents the i-th selected child, which
  54.      * is different from the i-th child.
  55.      *
  56.      * @param i the zero-based index of selected children
  57.      * @return the i-th selected child
  58.      * @see #getAccessibleSelectionCount
  59.      */
  60.      public Accessible getAccessibleSelection(int i);
  61.  
  62.     /**
  63.      * Determines if the current child of this object is selected.
  64.      *
  65.      * @return true if the current child of this object is selected; else false.
  66.      * @param i the zero-based index of the child in this Accessible object.
  67.      * @see AccessibleContext#getAccessibleChild
  68.      */
  69.      public boolean isAccessibleChildSelected(int i);
  70.  
  71.     /**
  72.      * Adds the specified Accessible child of the object to the object's
  73.      * selection.  If the object supports multiple selections,
  74.      * the specified child is added to any existing selection, otherwise
  75.      * it replaces any existing selection in the object.  If the
  76.      * specified child is already selected, this method has no effect.
  77.      *
  78.      * @param i the zero-based index of the child
  79.      * @see AccessibleContext#getAccessibleChild
  80.      */
  81.      public void addAccessibleSelection(int i);
  82.  
  83.     /**
  84.      * Removes the specified child of the object from the object's
  85.      * selection.  If the specified item isn't currently selected, this
  86.      * method has no effect.
  87.      *
  88.      * @param i the zero-based index of the child
  89.      * @see AccessibleContext#getAccessibleChild
  90.      */
  91.      public void removeAccessibleSelection(int i);
  92.  
  93.     /**
  94.      * Clears the selection in the object, so that no children in the
  95.      * object are selected.
  96.      */
  97.      public void clearAccessibleSelection();
  98.  
  99.     /**
  100.      * Causes every child of the object to be selected
  101.      * if the object supports multiple selections.
  102.      */
  103.      public void selectAllAccessibleSelection();
  104. }
  105.